package com.rem.designPattern.factory工厂方法.factoryMethoad;

/**
 * 咖啡类和子类
 *
 * @author Rem
 * @date 2022-11-14
 */
public abstract class Coffee {

    public abstract String getName();

    public void addsugar() {
        System.out.println("加糖");
    }

    public void addMilk() {
        System.out.println("加奶");
    }
}

class LatteCoffee extends Coffee {

    @Override
    public String getName() {
        return "拿铁咖啡";
    }
}

class AmericanCoffee extends Coffee {

    @Override
    public String getName() {
        return "美式咖啡";
    }
}
